package s2elinshu;

import java.util.Scanner;

public class J09SungJuk {
	public static void main(String[] args) {
		String name[] = new String[2];
        int kor[] = new int[2];
        int eng[] = new int[2];
        int mat[] = new int[2];
        int tot[] = new int[2];
        double avg[] = new double[2];
		char grd [] = new char[2];
		Scanner sc = null;
		String result[] = new String[2];
		
		inputSungJuk(sc, name, kor, eng, mat);
		
		// 성적처리
		getTotal(kor, eng, mat, tot);
		getAverage(avg, tot);
		getGrade(grd, avg);
		
	
	    System.out.println(name);   // 중요!! 변수명만 쓰면 해당 데이터가 있는 곳의 주소가 나옴.
	    System.out.println(name[1]);
	    System.out.println(kor);
	    System.out.println(kor[1]);
	    System.out.println(eng);
	    System.out.println(eng[1]);
	    System.out.println(mat);
	    System.out.println(mat[1]);
	    System.out.println(tot);
	    System.out.println(tot[1]);
	    System.out.println(avg);
	    System.out.println(avg[1]);
	    System.out.println(grd);
	    System.out.println(grd[1]);
		
        	

	} // main

public static void inputSungJuk(Scanner sc, String[] name, int[] kor, int []eng, int []mat) {
	sc = new Scanner(System.in);
	System.out.println("이름을 입력하세요");
	name[1] = sc.next();
	System.out.println("국어 점수를 입력하세요");
	kor [1] = sc.nextInt();
	System.out.println("영어 점수를 입력하세요");
	eng[1] = sc.nextInt();
	System.out.println("수학 점수를 입력하세요");
	mat[1] = sc.nextInt();
	sc.close();	
}	
public static void getTotal(int[] kor, int[] eng, int[] mat,int[] tot) {
	tot[1] = kor[1] + eng[1] + mat[1];	
}
public static void getAverage(double[] avg,int[] tot) {
	avg[1] = (double)tot[1] / 3;
}	
public static void getGrade(char[] grd,double[] avg) {
	switch ((int)avg[1]/10){
	case 10 :
	case 9 : grd[1]='수'; break;
	case 8 : grd[1]='우'; break;
	case 7 : grd[1]='미'; break;
	case 6 : grd[1]='양'; break;
	default : grd[1] = '가';
	}
	
	} // inputSungJuk

} // class
